////<!--异常放行-->
import api from '../../../fetch/api'

export default {
    data() {
        return {
            bigImgPath: '',
            vipType: {
                name:'',
                value:'',
            },
            typeInfo:[],
        }
    },
    created() {
        // this.getItemList();
    },
    methods: {
        getList() {
            let params = $.extend({}, this.searchParams, this.otherParams);
            console.log(this.otherParams)
            this.getItemList(params);            
            this.getTypeList(params);
            this.initVIPTypeSearch();
        },
        showBigImgModal(name, path) {
            this.bigImgPath = path;
            this.toOpenImgModal(name, path);
        },
        //获取列表
        getItemList(aparams) {
            let self = this,
                params = {
                    page: this.pageNumber,
                    rp: this.pageSize
                };
            params = $.extend({}, params, aparams);
            api.fetchGet('/park/abnormalOutCar/getAbnormalOutCarByPage.do', params)
                .then(res => {
                    // console.log('getListResult', res)
                    let data = res.data,
                        list = data.rows;
                    self.tbodysInfo = list;
                    self.total = data.total;
                }, err => { })
        },

        //获取vip类型列表
        getTypeList(aparams) {
            let self = this,
                params = {
                };
            var tep=[];
            self.typeInfo=[];
            params = $.extend({}, params, aparams);
            api.fetchGet('/park/abnormalOutCar/typeList.do', params)
                .then(res => {
                    let data = res.data;
                    tep = data;                    
                    var option={
                        name: '',
                        value: null,
                    };                    
                    option['name']='全部';
                    option['value']='';
                    self.typeInfo.push(option);
                    var option2={
                        name: '',
                        value: null,
                    };
                    option2['name']='临时车';
                    option2['value']='temp_car';
                    self.typeInfo.push(option2);
                    console.log(tep);
                    for(var i=0;i<tep.length;i++){
                        var option1={
                            name: '',
                            value: null,
                        };                        
                        var name=tep[i].vipName;
                        var value=tep[i].id;
                        option1['name']=name;
                        option1['value']=value;
                        self.typeInfo.push(option1);
                    }
                }, err => { });
            
        },
        initVIPTypeSearch(){
            let self = this;            
            self.searchList[6].options=self.typeInfo;
        },
        exportData() {
            let self = this;
            let params = {
            };
            params = $.extend({}, params, this.searchParams, this.otherParams);
            self.showDialog("确认导出该报表?", '', function () {
                self.toExportAsync('park/abnormalOutCar/exportAbnormalOutCar.do', params)
            })

        }
    }
}